#region

using System;
using System.Collections.ObjectModel;
using System.Windows.Documents;

#endregion

namespace HudsonMonitor.Notify
{
    /// <summary>
    ///   This is just a mock object to hold something of interest.
    /// </summary>
    public class NotifyObject
    {
        private string title;

        public NotifyObject(string message, string title)
        {
            Message = message;
            this.title = title;
        }

        public string Message { get; private set; }
    }

    /// <summary>
    ///   This is a TaskbarNotifier that contains a list of NotifyObjects to be displayed.
    /// </summary>
    public partial class ExampleTaskbarNotifier
    {
        private ObservableCollection<NotifyObject> notifyContent;

        public ExampleTaskbarNotifier()
        {
            InitializeComponent();
        }

        /// <summary>
        ///   A collection of NotifyObjects that the main window can add to.
        /// </summary>
        public ObservableCollection<NotifyObject> NotifyContent
        {
            get
            {
                if (notifyContent == null)
                {
                    // Not yet created.
                    // Create it.
                    NotifyContent = new ObservableCollection<NotifyObject>();
                }

                return notifyContent;
            }
            private set { notifyContent = value; }
        }

        private void ItemClick(object sender, EventArgs e)
        {
            Hyperlink hyperlink = sender as Hyperlink;

            if (hyperlink == null)
                return;

            NotifyObject notifyObject = hyperlink.Tag as NotifyObject;
            if (notifyObject != null)
            {
                MainWindow.GetReference().Show();
            }
        }

        private void HideButtonClick(object sender, EventArgs e)
        {
            ForceHidden();
        }
    }
}